import request from '@/utils/request';

export async function query() {
  return request('/api/users');
}

// 获取当前用户登录信息
export async function queryCurrent() {
  return request('/admin/user');
}

// 获取用户列表
export async function getUsers(params) {
  return request('/admin/users', { params });
}

// 启用/禁用用户
export async function lockUser(uid) {
  return request.patch(`/admin/users/${uid}/lock`);
}

// 添加用户
export async function addUser(params) {
  return request.post('/admin/users', { params });
}

// 用户详情
export async function showUser(editId) {
  return request(`/admin/users/${editId}`);
}

// 编辑用户
export async function updateUser(editId, params) {
  return request.post(`/admin/users/${editId}`, { params });
}

export async function queryNotices() {
  return request('/api/notices');
}
